1. Technical Field
This invention relates to method and execution program for reading and displaying a two-dimensional code that enable the reconstruction of prescribed digital information expressed in the two-dimensional code, through computer analysis of the two-dimensional code in image data obtained from an image-capturing device such as a camera or a scanner. The two-dimensional code referred to in this invention is either outputted from a recording device to sheet-like recording media or a solid object surface, or displayed on a display device.
2. Related Arts
A two-dimensional code is generally composed of a number of cells arranged in a lattice pattern and positioning symbols disposed around the cells, and is used to express digital information on a flat surface. The cells are envisioned on a white flat surface and composed of two types of cells: 1) marked cells with a black data mark on each cell and 2) white blank cells without any data marks. In a two-dimensional code, digital information is expressed by a formation of a layout pattern denoted by two types of cells. For example, by substituting the marked cells to 1 and the blank cells to 0, the digital information is expressed on a surface by binary data string of 1 and 0.
For a two-dimensional code represented in such a way, image data is obtained by using an image-capturing device and the digital information is reconstructed by analyzing the obtained image data. By using a computer for analyzing, the position of the cells in image data is calculated, and the displayed cells is detected on its position. As a result, the displayed cells are distinguished and the binary data string expressed in a two-dimensional code is reconstructed.
In doing so, the position of cells is calculated based on the positioning symbols denoted at a given fixed location. For example, the size and the orientation of a two-dimensional code in image data is obtained by detecting the distance and the angle between more than two detected positioning symbols, and based on this information, a method for calculating the position of each cell is known (Japanese Patent Publication No. 254037/1995, JIS X0510 Two-dimensional code symbol-QR code-Basic specification).
Furthermore, the display of cells is detected by the pixel tone value (gray level) at the approximate center of a cell. In other word, the pixel tone at the center of a cell is compared to a preliminarily set threshold value, and the pixel tone that is darker than the threshold value is considered as a marked cell and the lighter one is considered as a blank cell.
A two-dimensional code, by expressing digital information two-dimensionally on a display surface, can provide a representation with a higher density than a conventional bar code. In other words, with a two-dimensional code, a large amount of information can be represented on a display surface of a limited capacity. Due to such a feature, two-dimensional codes have been utilized in various ways in recent years.
For example, two-dimensional codes record digital information such as textual information, numerical information, image information, audio information, crypto information and computer command codes, onto sheet-like media like a paper and surfaces of solid objects like an electronic component, which are used for reconstructing such digital information after obtaining an image from an image-capturing device. Furthermore, it is used to transfer information between devices by reconstructing the digital information from a two-dimensional code taken by an image-capturing device and shown on a display device.
Along with technological progress in the acceleration of computer processing speed and the augmentation of recording media capacity, a larger amount of digital information is treated today than with the technology of the past. In addition, along with the progress in communications technology, the network environment that allows easy transmission of such digital information is created. For that reason, it is possible to handle information in various situations independent of time and space constraints.
Also for a two-dimensional code, it is required to display a large amount of digital information with higher density than previously. Moreover, it is required to treat such a high density two-dimensional code in various situations, by using input-output devices. Herewith, there is hope to handle digital information even more easily and more comfortably.
In order to increase the density of the display of a two-dimensional code, it is necessary to make the size of each cell small and to increase the number of cells per unit area. However, as the cell size becomes smaller, a problem of misalignment is likely to occur when determining the cell display. At the same time, the cell display is likely to become unclear and the pixel tone degree inaccurate for determining the display. This inaccuracy of the pixel tone degree occurs notably with a colored two-dimensional code that has colored cells. As a result, an error occurs when determining the display of a cell, and the digital information cannot be reconstructed accurately.
Such misalignment and inaccurate pixel tone degree are thought to be caused by a distortion of the image data surface occurring from the fluctuation of image-capturing conditions. During the output of a two-dimensional code, such misalignment and inaccuracy can occur, for example, when the output interval is miscalculated by the output device or when a display surface has any curvature. Moreover, during the input of a two-dimensional code, such misalignment can be caused by an optical distortion of the camera lens or by an incorrect orientation of a shooting angle.
In order to solve the problem of misalignment, the following method is known: to display the timing cell consisting of marked cells and blank cells that are located alternately around the area where the data cells are aligned and to adjust the position of the data cells by referring to the edges of the timing cells (Japanese Patent Publication No. 254037/1995). However, even with this method, a problem of misalignment is likely to occur with the data cells that are far from the timing cells. If the number of the timing cells is increased to prevent such misalignment, the number of data cells containing information will be decreased, and therefore, it is not enough to have a higher density of information.
On the other hand, in order to solve the problem of inaccurate pixel tone degree, the following method is known: to calculate the average pixel tone degree of the entire image data and to use this value as the threshold value of display determination (JIS X0510 Two-dimensional code symbol-QR code-Basic specification). With this method, it is possible to determine the display by considering the fluctuation of the pixel tone degree of the entire image occurring from the fluctuation of the input-output conditions. However, with this method, if there is a distortion of the pixel tone degree within the image surface, there can be inaccuracy in the pixel tone degree in different areas. Therefore, it is not enough to solve this problem with this method.
This invention was achieved as a result of thorough consideration of said challenges. The purpose of this invention, “Method and Execution Program for Reading and Displaying a Two-dimensional code”, is to enable the display of digital information with high cell density and to enable an accurate reading of digital information, while responding to the various conditions described above.